The present invention relates generally to an apparatus in which an objective pattern is extracted by an image sensor, such as a television camera, and then subjected to image processing to detect a rotational angle in order to inspect or recognize the objective pattern.
One conventional detection system utilizes a method, known as the moment of inertia method of calculation, in which the optically-sensed image of a pattern is binary-coded, and in which a main axis and a center of gravity of an equivalent ellipse are obtained from calculations using the linear moment M, quadratic moment I.sub.x, I.sub.y, synergistic moment I.sub.xy and an area A of the binary-coded image.
Thus, an angle of rotation .theta. and a center of gravity P.sub.G (P.sub.GX, P.sub.GY) are calculated according to the following expressions (1)-(3): EQU tan 2.theta.=2I.sub.xy /(I.sub.y -I.sub.x) (1) EQU P.sub.GX =M.sub.x /A (2) EQU P.sub.GY =M.sub.y /A (3)
where the various symbols are defined as follows:
M.sub.x : the linear moment of the pattern with respect to the x-axis; PA1 M.sub.y : the linear moment of the pattern with respect to the y-axis; PA1 I.sub.x : the quadratic moment of the pattern with respect to the x-axis; PA1 I.sub.y : the quadratic moment of the pattern with respect to the y-axis; PA1 I.sub.xy : the synergistic moment of the pattern; PA1 P.sub.GX : the x-distance of the center of gravity; PA1 P.sub.GY : the y-distance of the center of gravity; and PA1 A: the area of the objective pattern.
Using this moment of inertia method of calculation, the angle of rotation .theta. can be detected with relatively high accuracy for an elongated objective pattern, but not for an objective pattern which is more square or circular. In square or circular patterns, the quadratic moments I.sub.x and I.sub.y have similar values and very small errors in quantization of the pattern are magnified when the denominator at the right-hand side of the above-mentioned expression (1) approaches zero. Therefore, if the rotation of an objective pattern is normalized by using an angle of rotation obtained by the moment of inertia method described above, errors could occur due to the introduction of errors based on shape-dependent calculations rendering any further pattern inspection and recognition of little practical use.